package com.chenlonghai.sbmybatis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chenlonghai.sbmybatis.dao.OpinionDao;
import com.chenlonghai.sbmybatis.entity.Opinion;
import com.chenlonghai.sbmybatis.service.OpinionService;

@Service
public class OpinionServiceImpl implements OpinionService {

	@Autowired
	private OpinionDao opinionDao;
	
	
	@Override
	public List<Opinion> queryOpinion() {
		// TODO Auto-generated method stub
		return opinionDao.queryOpinion();
	}


	@Override
	public List<Opinion> queryOpinionByType(Opinion opinion) {
		// TODO Auto-generated method stub
		return opinionDao.queryOpinionByType(opinion);
	}


	@Override
	public boolean deleteById(int id) {

		// TODO Auto-generated method stub
		return  opinionDao.deleteById(id)>0;
	}


	@Override
	public boolean insertOpinion(Opinion opinion) {
		// TODO Auto-generated method stub
		return opinionDao.insertOpinion(opinion) >0;
	}


	@Override
	public Opinion queryOpinionById(int id) {
		// TODO Auto-generated method stub
		return opinionDao.queryOpinionById(id);
	}


	@Override
	public boolean updateOpinion(Opinion opinion) {
		// TODO Auto-generated method stub
		return opinionDao.updateOpinion(opinion) >0;
	}

}
